package com.fxp.project.jiuselu.web.models.fare.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fxp.project.jiuselu.web.models.fare.entity.JslUserFareApplied;
import com.fxp.project.jiuselu.web.models.fare.mapper.JslUserFareAppliedMapper;
import com.fxp.project.jiuselu.web.models.fare.service.IJslUserFareAppliedService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 用户已申请发票表 服务实现类
 * </p>
 *
 * @author Jason.Wang
 * @since 2021-11-24
 */
@Service
public class JslUserFareAppliedServiceImpl extends ServiceImpl<JslUserFareAppliedMapper, JslUserFareApplied> implements IJslUserFareAppliedService {

    @Autowired
    JslUserFareAppliedMapper jslUserFareAppliedMapper;

    /**
     * selectJslUserFareAppliedListById: 查询当前用户的开票历史<br/>
     *
     * @param currentPage
     * @param pageSize
     * @param currentDate
     * @param userId
     * @return
     * @author Jason.Wang
     * @date 2021/11/25 12:05 上午
     */
    @Override
    public PageInfo<?> selectJslUserFareAppliedListById(Integer currentPage, Integer pageSize, LocalDateTime currentDate, Long userId) {
        PageHelper.startPage(currentPage,pageSize);
        List<JslUserFareApplied> list = jslUserFareAppliedMapper.selectJslUserFareAppliedListById(currentDate,userId);
        return new PageInfo<>(list);
    }

    @Override
    public List<JslUserFareApplied> selectUserFareAppliedList(BigDecimal fareMoney, String phone) {
        return jslUserFareAppliedMapper.selectUserFareAppliedList(fareMoney,phone);
    }
}
